package com.android.angle;

public class AngleSpriteCollider {
	
	private float Ax;
	private float Ay;
	private float Aw;
	private float Ah;
	private float Bx;
	private float By;
	private float Bw;
	private float Bh;
	
	public AngleSpriteCollider(AngleAbstractSprite sprite) {
		Ax = sprite.mPosition.mX;
		Ay = sprite.mPosition.mY;
		Aw = sprite.roLayout.roWidth;
		Ah = sprite.roLayout.roHeight;
	}
	

	
	public boolean test(AngleAbstractSprite otherCollider){
		Bx = otherCollider.mPosition.mX;
		By = otherCollider.mPosition.mY;
		Bw = otherCollider.roLayout.roWidth;
		Bh = otherCollider.roLayout.roHeight;
		if (Ax + Aw > Bx && Ax < Bx + Bw &&
				Ay + Ah > By && Ay < By + Bh){
			return true;
		}else{
			return false;
		}
		/*float r1 = (Math.max(Aw, Ah) / 2 + 1);
		float r2 = (Math.max(Bw, Bh) / 2 + 1);
		float rSquard = r1 * r1;
		float anrSquard = r2 * r2;
		float disX = Ax - Bx;
		float disY = Ay - By;

		if ((disX * disX) + (disY * disY) < (rSquard + anrSquard))
			return true;
		else
			return false;*/
	}
	

}
